<?php
namespace app\common\controller;


use app\common\model\Order;
use app\common\traits\Gate;
use think\Controller;
use think\helper\Time;

class Base extends Controller
{
    use Gate;
    protected function _initialize(){
        parent::_initialize();
//        echo "<span style='color: red;'>系统临时维护！</span>";die;
    }
    /**
     * 判断浏览器是否为ie
     * @return bool
     */
    public function getBower()
    {
        $str = getBrowser();
        if($str=='ie'){
            return true;
        }
        return false;
    }

    public function gettixing(){
        $this->yyjrzztx();//今日邀约提醒
    }

    /*邀约今日追踪提醒   条件*/
    public function yyjrzztx(){
        if(is_administrator() || $this->hasRole('yaoyuejingli') || $this->hasRole('yaoyuezhuguan')  || $this->hasRole('yaoyuezhuanyuan')){
//            $map['zztime'] = ['lt',strtotime(date('Y-m-d'))];
            $map['zztime'] = ['between',Time::today()];
            $map['ywstate'] = ['not in',[3,5,6]];
            $map['status'] = 1;
            if($this->hasRole('yaoyuezhuguan')){
                $map['ygroup_id'] = session('admin_user.ygroup_id');
            }
            if($this->hasRole('yaoyuezhuanyuan')){
                $map['yykf'] = session('admin_user.adminid');
            }
            $jrzznum = Order::tixing($map);
            $this->assign('jrzznum',$jrzznum);
        }else{
            $this->assign('jrzznum',0);
        }
    }


}